package com.yhhvip.lottery.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
@ToString
public class ActivityVo implements Serializable {

    @NotEmpty(message = "奖品列表不能为空")
    @ApiModelProperty(value = "奖品列表", example = "[{\"prizeName\":\"test\",\"count\":1,\"type\":1,\"level\":1}]", required = true, position = 1, dataType = "List")
    private List<PrizeVo> prizes;

    @ApiModelProperty(value = "赞助商", example = "深圳未来科技集团", required = false, position = 2)
    private String prizeProvider;

    @ApiModelProperty(value = "是否跳转小程序(0:不跳转, 1:跳转)", example = "1", required = false, position = 3)
    private Byte isForward;

    @ApiModelProperty(value = "小程序路径", example = "www.baidu.com", required = false, position = 4)
    private String smAppUrl;

    @ApiModelProperty(value = "小程序名称", example = "考拉抽奖", required = false, position = 5)
    private String smAppName;

    @NotNull(message = "开奖方式不能为空")
    @ApiModelProperty(value = "开奖方式(1:自动开奖, 2:2天内到达指定人数自动开奖, 3:手动开奖)", example = "1", required = true, position = 6)
    private Byte ruleType;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ApiModelProperty(value = "开奖时间", example = "2018-06-30 12:00", required = false, position = 7)
    private Date setLotteryTime;

    @ApiModelProperty(value = "参与口令", example = "123456789", required = false, position = 8)
    private String joinPwd;

    @ApiModelProperty(value = "设置参与人数开奖", example = "100", required = false, position = 9)
    private Integer setNum;

    @NotNull(message = "上下架状态不能为空")
    @ApiModelProperty(value = "上下架状态(0:下架, 1:上架)", example = "1", required = true, position = 10)
    private Byte putStatus;

    @NotNull(message = "活动创建者ID不能为空")
    @ApiModelProperty(value = "活动创建者ID(系统管理员传9999999999(10个9))", example = "1", required = true, position = 11)
    private Long createById;

    @NotEmpty(message = "创建者名称不能为空")
    @ApiModelProperty(value = "创建者名称(系统管理员传admin+管理员名称)", example = "testName", required = true, position = 12)
    private String createByName;

    @ApiModelProperty(value = "活动说明(也是赞助商介绍)", example = "这是一个用来测试的活动,中奖到的东西都不会给你发货", required = false, position = 13)
    private String providerInformation;

    @NotEmpty(message = "活动奖品图片不能为空")
    @ApiModelProperty(value = "活动奖品图片", example = "testActivityPrizeImgUrl", required = true, position = 14)
    private String activityPrizeImgUrl;

    @NotNull(message = "活动类型不能为空")
    @ApiModelProperty(value = "活动类型(1:官方活动, 2:个人活动)", example = "1", required = true, position = 15)
    private Byte type;

    @ApiModelProperty(value = "参与次数限制", example = "10", required = false, position = 16)
    private Integer joinLimit;

    @NotNull(message = "参加条件类型不能为空")
    @ApiModelProperty(value = "参与条件类型(0:没有条件, 1:参与密码, 2:参与次数, 3:参与密码与次数)", example = "1", required = true, position = 7)
    private Byte joinCondType;
}
